1. Technical Field
The present invention relates generally to an improved data processing system and in particular to an improved method and apparatus for optimizing transfer of code to a data processing system. Still more particularly, the present invention relates to an improved method and apparatus for creating and sending class files to a data processing system in which the class files are optimized for the data processing system.
2. Description of Related Art
Internet, also referred to as an xe2x80x9cinternetworkxe2x80x9d, in communications is a set of computer networks, possibly dissimilar, joined together by means of gateways that handle data transfer and the conversion of messages from the sending network to the protocols used by the receiving network (with packets if necessary). When capitalized, the term xe2x80x9cInternetxe2x80x9d refers to the collection of networks and gateways that use the TCP/IP suite of protocols.
The Internet has become a cultural fixture as a source of both information and entertainment. Many businesses are creating Internet sites as an integral part of their marketing efforts, informing consumers of the products or services offered by the business or providing other information seeking to engender brand loyalty. Many federal, state, and local government agencies are also employing Internet sites for informational purposes, particularly agencies which must interact with virtually all segments of society such as the Internal Revenue Service and secretaries of state. Operating costs may be reduced by providing informational guides and/or searchable databases of public records online.
Currently, the most commonly employed method of transferring data over the Internet is to employ the World Wide Web environment, also called simply xe2x80x9cthe webxe2x80x9d. Other Internet resources exist for transferring information, such as File Transfer Protocol (FTP) and Gopher, but have not achieved the popularity of the web. In the web environment, servers and clients effect data transaction using the Hypertext Transfer Protocol (HTTP), a known protocol for handling the transfer of various data files (e.g., text, still graphic images, audio, motion video, etc.). Information is formatted for presentation to a user by a standard page description language, the Hypertext Markup Language (HTML). In addition to basic presentation formatting, HTML allows developers to specify xe2x80x9clinksxe2x80x9d to other web resources identified by a Uniform Resource Locator (URL). A URL is a special syntax identifier defining a communications path to specific information. Each logical block of information accessible to a client, called a xe2x80x9cpagexe2x80x9d or a xe2x80x9cweb pagexe2x80x9d, is identified by a URL. The URL provides a universal, consistent method for finding and accessing this information by the web xe2x80x9cbrowserxe2x80x9d. A browser is a program capable of submitting a request for information identified by a URL at the client machine. Retrieval of information on the web is generally accomplished with an HTML-compatible browser.
When a user desires to retrieve a page, a request is submitted to a server connected to a client computer at which the user is located and may be handled by a series of servers to effect retrieval of the requested information. The information is provided to the client formatted according to HTML. Typically, personal computers (PCs) along with workstations are typically used to access the Internet.
Often applications or programs may be sent to a computer from a web server across the Internet. Java applications are becoming increasingly more prevalent as the type of application sent between web servers and client computers. Java applications are common on the Internet and becoming more increasingly common in intranets and in other types of networks used in businesses.
Java is an object oriented programming language and environment focusing on defining data as objects and the methods that may be applied to those objects. Java supports only a single inheritance, meaning that each class can inherit from only one other class at any given time. Java also allows for the creation of totally abstract classes known as interfaces, which allow the defining of methods that may be shared with several classes without regard for how other classes are handling the methods.
The Java virtual machine (JVM) is a virtual computer component that resides only in memory. The JVM allows Java programs to be executed on a different platform as opposed to only the one platform for which the code was compiled. Java programs are compiled for the JVM. In this manner, Java is able to support applications for many types of data processing systems, which may contain a variety of central processing units and operating systems architectures. To enable a Java application to execute on different types of data processing systems, a compiler typically generates an architecture-neutral file formatxe2x80x94the compiled code is executable on many processors, given the presence of the Java run-time system. The Java compiler generates bytecode instructions that are non-specific to a particular computer architecture. A bytecode is a machine independent code generated by the Java compiler and executed by a Java interpreter. A Java interpreter is a part in the JVM that alternately decodes and interprets a bytecode or bytecodes. These bytecode instructions are designed to be easy to interpret on any computer and easily translated on the fly into native machine code. In a networked environment, different versions of class files may be stored on a server for delivery to various clients in the networked environment. In many cases, optimizations to class files may be available depending on the client machine on which the class file will be loaded. However, these optimizations are usually restricted to a particular set of hardware, operating system and/or Java virtual machine.
Therefore, it would be advantageous to have an improved method and apparatus for managing class files, and categorizing optimized versions of class file content, in a networked environment.
The present mechanism provides a method and apparatus in a distributed data processing system for processing class files. A first data structure is received at a server. The first data structure includes a plurality of bytecodes and optimized content. A set of elements is identified in the optimized content. The set of elements is stored. Responsive to a request from a client, a second data structure is created. This second data structure includes the plurality of bytecodes and an element from the set of elements.